package com.aiflow.system;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;


import com.aiflow.bean.User;

public class SessionListener implements HttpSessionListener {

	public void sessionCreated(HttpSessionEvent arg0) {

	}
	
	/**
	 * session的销毁方法
	 */
	public void sessionDestroyed(HttpSessionEvent arg0) {
		System.out.println("session失效了!!!");
		HttpSession session = arg0.getSession();
	     // 取得登录的用户名
		 User use = (User)session.getAttribute("user");
		if(null==use) return; //如果用户没有登录则不处理
	}
	

}
